package com.tjbank.cssys.web.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.tjbank.cssys.domain.CkErrorLog;
import com.tjbank.cssys.domain.CkLog;
import com.tjbank.cssys.repository.CkErrorLogMapper;
import com.tjbank.cssys.web.service.CkErrorLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Map;

@Service
public class CkErrorLogServiceImpl  implements  CkErrorLogService{
    @Autowired
    private CkErrorLogMapper ckErrorLogMapper;

    @Override
    public PageInfo selectError(CkErrorLog ckErrorLog,Integer page, Integer pageSize, HttpServletRequest request) {
        PageHelper.startPage(page, pageSize);
        List<CkErrorLog> ckErrorLogs = ckErrorLogMapper.selectError(ckErrorLog);
        PageInfo<CkErrorLog> pageInfo = new PageInfo<>(ckErrorLogs);
        return pageInfo;
    }

    @Override
    public void insertCkErrotLog(CkErrorLog ckErrorLog) {
        ckErrorLogMapper.insert(ckErrorLog);
    }
}
